package com.zimmor.listener;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author:zimmor
 * @Date: 2021/12/29 23:46
 * @Description 点对点直连模型 消费者 第一种方式 rabbitLister + rabbitHandler
 * @version: 1.0.0
 */
@Component
//@RabbitListener(queuesToDeclare = @Queue("hello"))
@RabbitListener(queues = "hello")
public class Customer1 {
    @RabbitHandler
    public void getMessage(String message) {
        System.out.println("消费者1接收到的消息：" + message);
    }
}
